$(function(){

	$('.modal').modal({
		backdrop: "static",
		keyboard: false,
		show: false
	});
	//删除
	$('.news-delete-btn').on('click',function(){
		var newsId = $(this).parents('tr').attr('data-news-id');
		var $this = $(this);

		actionConfirm({
			msg: '确定要删除这条资讯吗？',
			confirm: function(){
				cAjax({
					url:'/cms/news/delete',
					data:{newsId: newsId},
					success:function(obj){
						$this.parents('tr').addClass('deleted');
						$this.parent().html('<span class="label label-warning">已删除</span>');
					}
				});
			}	
		});

	});	
	//搜索
	$("#list-search").on("submit",function(){
		if ($("#search").val()==""){ 
			greeting({msg:"请输入编号、标题或者作者姓名",title:"提示"}); 
			return false;
			
		}else
			return true;
	});
	//生成二维码
//	$('.td-rqcode').each(function(){
//		alert(qrUrl);
//		var $this = $(this);
//		$(this).find('div').qrcode({
//			render: "table",
//			height: 30,
//			width: 40,
////			text: $this.attr('rq-text')
//			text: $this.attr(qrUrl)
//		})
//	})
	//放大二维码
	$("div [coverpic='rqcode']").on("click",function(){
		//var bigRQ = $(this).parents("tr").find("td:eq(3)").find("a").html();
		var qrUrl = $(this).parents("tr").find("td:eq(3)").find("a").html();
		$("#qrcode_show").html("");
		$("#show-rqcode-modal").find("#qrcode_show").qrcode({
		//	render: "table",
			height: 200,
			width: 200,
			text: qrUrl
		})
		$("#show-rqcode-modal").modal('show');
	})
	
});	
	

	

